package config

import (
	"common/helper"
	"database/sql"
)

/*
流水返利配置
*/

type CfgProxyCommiReturnItem struct {
	Deposit    float64 `json:"deposit" db:"deposit" cbor:"deposit"`
	ReturnRate int     `json:"return_rate" db:"return_rate" cbor:"return_rate"`
}
type CsProxyCommiReturnCfg struct{}

var cfgProxyCommiList []CfgProxyCommiReturnItem

func (that *CsProxyCommiReturnCfg) GetCfg() []CfgProxyCommiReturnItem {
	return cfgProxyCommiList
}

func ProxyCommiReturnRemove() {
	cfgProxyCommiList = []CfgProxyCommiReturnItem{}
}

func ProxyCommiReturnSetRow(rows *sql.Rows) {
	var tVal CfgProxyCommiReturnItem
	var err error
	err = rows.Scan(&tVal.Deposit, &tVal.ReturnRate)
	if err != nil {
		helper.InfoLog("ProxyCommiReturnSetRow,scan err")
	}

	cfgProxyCommiList = append(cfgProxyCommiList, tVal)
}
